﻿using HZY.Host.Admin.ApplicationServices.Apps;
using Microsoft.AspNetCore.Authorization;
namespace HZY.Host.Admin.Controllers.Apps;

/// <summary>
/// 国际化 控制器
/// </summary>
[ControllerDescriptor(DisplayName = "国际化")]
public class SysLocaleController(IServiceProvider serviceProvider)
: AdminControllerBase<SysLocaleService, SysLocale, Guid, SysLocale, SysLocale>(serviceProvider)
{
    /// <summary>
    /// 获取国际化内容
    /// </summary>
    /// <param name="key"></param>
    /// <returns></returns>
    [AllowAnonymous]
    [ActionDescriptor(DisplayName = "获取国际化内容")]
    [HttpGet("{key}")]
    public Task<string?> FindLocaleAsync([FromRoute] string key)
    {
        return Service.FindLocaleAsync(key);
    }
}